<?php
	namespace Annoubas\BaseBundle\Entity;
	
	use Doctrine\ORM\Mapping as ORM;
	use Symfony\Component\Validator\Constraints as Assert;
	
	/**
	 * @ORM\Entity
	 */
	
	class Rubs {
		/**
		 * @ORM\GeneratedValue(strategy="AUTO")
		 * @ORM\Id
		 * @ORM\Column(type="integer")
		 */
		private $idr;
		
		/**
		 * @ORM\Column(type="string", length="255")
		 * @Assert\NotBlank()
		 * @Assert\MinLength(3)
		 */
		private $name;
        
        /**
        * @ORM\OneToMany(targetEntity="SubRubs", mappedBy="Rubs")
        */
        protected $subrub;
	
    
    
    public function __construct()
    {
        $this->subrub = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Get idr
     *
     * @return integer 
     */
    public function getIdr()
    {
        return $this->idr;
    }

    /**
     * Set name
     *
     * @param string $name
     */
    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Add subrub
     *
     * @param Annoubas\BaseBundle\Entity\SubRubs $subrub
     */
    public function addSubRubs(\Annoubas\BaseBundle\Entity\SubRubs $subrub)
    {
        $this->subrub[] = $subrub;
    }

    /**
     * Get subrub
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getSubrub()
    {
        return $this->subrub;
    }
}